/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package sonia.golf.dao;

//~--- non-JDK imports --------------------------------------------------------

import sonia.golf.Service;
import sonia.golf.dao.sqlite.SQLiteDAOFactory;

/**
 *
 * @author Sebastian Sdorra
 */
public abstract class DAOFactory implements Service
{

  /** Field description */
  private static volatile DAOFactory instance;

  //~--- get methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @return
   */
  public static DAOFactory getInstance()
  {
    if (instance == null)
    {
      synchronized (DAOFactory.class)
      {
        if (instance == null)
        {

          // TODO make it plugable
          instance = new SQLiteDAOFactory();
        }
      }
    }

    return instance;
  }

  /**
   * Method description
   *
   *
   * @return
   */
  public abstract ConfigDAO getConfigDAO();

  /**
   * Method description
   *
   *
   * @return
   */
  public abstract CourseDAO getCourseDAO();

  /**
   * Method description
   *
   *
   * @return
   */
  public abstract PlayerDAO getPlayerDAO();
}
